<?php
  require_once('../db.php');
  $usersQuery = "SELECT * FROM `users`";
  pq($usersQuery);
  $usersResult = mysql_query($usersQuery) or die(mysql_error());

?>
<table  border="1" cellpadding="0" cellspacing="0" width="80%" align="center">
  <thead>
    <tr>
      <th colspan="6">:: All Users ::</th>
    </tr>
    <tr>
      <th>#</th>
      <th>Name</th>
      <th>Email</th>
      <th>Added Date</th>
      <th>Status</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
<?php
  while($user = mysql_fetch_assoc($usersResult))
  {
    //pr($user);
    $status = $user['status'];
    $id = $user['id'];
    $email = $user['email'];
?>

    <tr>
      <td><?=$id?></td>
      <td><?=$user['uname']?></td>
      <td><a href="mailto:<?=$email?>"><?=$email?></a></td>
      <td><?=date('d-M-Y G:i a',strtotime($user['added_date']))?></td>
      <td><?=getStatus($status)?></td>
      <td><a href="#">Edit</a> / <a href="#">Delete</a></td>
    </tr>
<?php
  }
?>


  </tbody>
</table>
